<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
 <%@ include file="/commons/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>展览列表</title>
<link href="../style/css_member.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/common.js"></script>
<script src="../js/artDialog.js?skin=gray"></script>
<script src="../js/artDialog.iframeTools.js"></script>
<script type="text/javascript" src="../js/jquery-1.3.2.js"></script>
<script language="javascript" type="text/javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">

	/**************  查询  *******************/
	function search(){
		var actionUrl = "${ctx}/exhibition/list.do";
		
		$("#curPage").val(1);
		$("#searchForm").attr("action",actionUrl);
		$("#searchForm").submit();
	}
	

	/******改变展览状态 *****/
	function changeState(id,status){
		if(status == '2'){
			if (window.confirm("该操作将删除展览及其所有作品，确定执行此操作？")) {
				$.ajax( {
					type : "POST",
					url : "${ctx}/exhibition/changeUploadState.do?exhibition.id="+id+"&operateStr="+status,
					timeout : 6000,
					async : false, //ajax同步
					success : function(data, textStatus) {
						if(data == '0000'){
							window.location.reload(true);
						}
					}
				});
			}
	  }else{
				$.ajax( {
					type : "POST",
					url : "${ctx}/exhibition/changeUploadState.do?exhibition.id="+id+"&operateStr="+status,
					timeout : 6000,
					async : false, //ajax同步
					success : function(data, textStatus) {
						if(data == '0000'){
							window.location.reload(true);
						}
					}
				});
			}
	}
	

	/******  预览   ****/
	function preview(id){
		var curPage = $("#curPage").val();
		var	actionUrl =  "${ctx}/exhibition/showDetail.do?id="+id+"&curPage="+curPage;
		window.location.href = actionUrl ;
	}

	$(function(){

		m2('m1_005','m1_005_03');
	});

</script>
</head>

<body>

<!-- 页面头部  -->
<jsp:include page="/commons/head_member.jsp"></jsp:include>

<form action="${ctx}/exhibition/list.do" id="searchForm" name="searchForm" method="post">
<table width="960" cellpadding="0" cellspacing="0" class="tbl_list_border" align="center">
<tr><td>
		<table width="900" border="0" cellspacing="0" cellpadding="0" align="center" style="margin: 0 auto;">
			<tr><td>
			<table width="100%" cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td class="nw12a" width="60" align="right">
				展览名称：</td><td><input name="filterTxt" value="title" type="hidden"/>
				<input name="filterValue" type="text" size="15" value="${filterValue }"/>
				<img src="../images/an25.gif" width="50" height="21" onclick="return search()" style="cursor: pointer;vertical-align: middle;" >
				</td>
			</tr>
			<tr>
			<td class="nw12a"  align="right">
				开始时间：</td><td style="font-family: 宋体;font-size: 12px;"> <input name="startDate" type="text" size="15" onClick="WdatePicker()" value="<fmt:formatDate value='${startDate }' pattern='yyyy-MM-dd'/>">&nbsp;&nbsp;
              	结束时间：<input name="endDate" type="text" size="15" onClick="WdatePicker()"  value="<fmt:formatDate value='${endDate }' pattern='yyyy-MM-dd'/>">&nbsp;&nbsp;
				<img src="../images/an25.gif" width="50" height="21" onclick="return search()" style="cursor: pointer;vertical-align: middle;" >
				</td>
			</tr>
			<tr><td height="5"></td></tr>
			</table>
			</td></tr>
			<tr><td colspan="100%">
             <table width="900" border="0" cellpadding="0" cellspacing="1" bordercolor="#0099CC" bgcolor="#0099CC">
                  <tr bgcolor="#CDE1ED">
                    <td class="nw12b" height="30"><div align="center">主题</div></td>
                      <td class="nw12b"><div align="center">发布者</div></td>
                    <td class="nw12b"><div align="center">发布时间</div></td>
                    <td class="nw12b"><div align="center">作品数量</div></td>
                    <td class="nw12b"><div align="center">编辑</div></td>
                    </tr>
                    <c:forEach items="${page.result}" var="result" varStatus="status">
	                  <tr bgcolor="#FFFFFF">
	                    <td class="nw12b" height="30"><div align="center">
	                    	<a href="${ctx }/front/exhibitionAction!exhibitionDetail.do?id=${result.id }" target="_blank">
	                   			 ${result.title }
	                    	</a>
	                    </div></td>
	                    <td class="nw12b"><div align="center">${result.entryPerson.username }</div></td>
	                    <td class="nw12b"><div align="center"><fmt:formatDate value="${result.uploadTime }" pattern="yyyy-MM-dd HH:mm"/></div></td>
	                    <td class="nw12b"><div align="center">${result.totalCount }</div></td>
	                    <td class="nw12b" align="center">
	                    <a style="color: blue;cursor: pointer" href="${ctx}/exhibition/showDetail.do?exhibition.id=${result.id }">修改</a>
	                    &nbsp;  
	                   	 <a href="javascript:changeState(${result.id },'2')" style="color: blue;cursor: pointer" >删除</a>  
	                   	     &nbsp;	                    
	                   	<c:choose>
	                    	<c:when test="${result.auditState.id == 3 }">
	                    		<a style="color: blue;cursor: pointer"  href="javascript:changeState(${result.id },'4')">不通过</a>&nbsp;
	                    	</c:when>
	                    	<c:otherwise>
	                    		<a style="color: blue;cursor: pointer"  href="javascript:changeState(${result.id },'3')">通过</a>&nbsp;
	                    	</c:otherwise>
	                    </c:choose>    
	                  		<c:if test="${result.uploadState.id == 1 }">
								<a style="color: blue;cursor: pointer"  href="javascript:changeState(${result.id },'1')">隐藏</a>
							</c:if>
							<c:if test="${result.uploadState.id == 2 }">
								<a style="color: blue;cursor: pointer"  href="javascript:changeState(${result.id },'5')">显示</a>
							</c:if>
	                    	</td>
	                    </tr>
                    </c:forEach>
                     
              </table></td>
            </tr>
            <tr>
              <td colspan="100%" class="nw12a" align="right" height="30"><jsp:include page="/commons/paging_footer.jsp"/> </td>
            </tr>
          </table>
</td></tr>
</table>
 </form>
    
<jsp:include page="/commons/foot_member.jsp"></jsp:include>

</body>
</html>